/*
 * @Descripttion:
 * @TapdLink: https://XXX
 * @DesignsLink: https://XXX
 * @RelatedPersons: XXX[市场]、XXX[产品]、XXX[前端]、XXX[后端]、XXX[设计]
 * @version: 1.0.0
 * @Author: Shentong
 * @LastEditors: Shentong
 * @Date: 2021-09-24 11:32:10
 */
import { server } from './server'


interface ISwiperBannerResponse {
  data?: DSwiperData
}
interface DSwiperData {
  images: Array<any>
  cates: Array<any>
}
// banner轮播
export const getBanner = () => {
  return server.POST<any, any>('/index/pop')
}

// swiper-banner轮播
export const getSwiper = () => {
  return server.POST<any, ISwiperBannerResponse>(`/index/cates/images`)
}

// 商品列表
export const getShopList = (params) => {
  return server.POST<any, ISwiperBannerResponse>(`/shop/search?sortType=${params.sortType}&cateId=${params.cateId}&lat=${params.lat}&lon=${params.lon}&schoolId=${params.schoolId}&offset=${params.offset}&pageSize=${params.pageSize}`)
}
